<%@ page isELIgnored="false" %> <!-- isELIgnored=true禁用表达式 -->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>修改密码页面</title>
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/layui-v2.6.13/layui/css/layui.css"/>
            <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.min-2.1.1.js"></script>
            <script type="text/javascript" src="<%=request.getContextPath() %>/layui-v2.6.13/layui/layui.js"></script>
	</head>
	<body>
		<div style="width: 100%; margin: 0 auto;">
			<input type="password" class="layui-input" placeholder="请输入要修改的密码" id="changePass">
			<br>
			<button class="layui-btn layui-btn-fluid" onclick="changePass()">确认修改</button>
		</div>
		<script>
		    function changePass(){
		        var changePass = $("#changePass").val();
		        console.info(changePass);
		        //提交修改后密码
		        $.ajax({
		            url:"changePass",
		            data:"id="+${user.id}+"&uPass="+changePass,
		            type:"post",
		            success: function(str){
		                console.info(str);
                        if(str == "1"){
                            alert("修改密码成功,请重新登录");
                            window.parent.location.href="loginPage";


                        }else{
                            alert("修改密码失败");
                        }
		            }
		        });

		    }
		</script>
	</body>
</html>